Skip to content

ModuleNotFoundError: No module named 'Shared.DC.ZRDB'#55

Closed
drfho wants to merge 1 commit intocodemonkey440/rendered_sql_clipboard_copy_buttonfrom
fix_ModuleNotFoundError
Closed

ModuleNotFoundError: No module named 'Shared.DC.ZRDB'#55
drfho wants to merge 1 commit intocodemonkey440/rendered_sql_clipboard_copy_buttonfrom
fix_ModuleNotFoundError

Conversation

@drfho
Copy link
Contributor

@drfho drfho commented Jan 17, 2026

Reference: #54 (comment)

The error ModuleNotFoundError: No module named 'Shared.DC.ZRDB' occurred because the Products.ZSQLMethods package may not be properly configured as a namespace package. I fixed this by:

  1. Creating init.py files for the Shared, Shared.DC, and Products namespace packages with the proper pkg_resources.declare_namespace() calls
    Updating the setup.py to explicitly declare Shared and Shared.DC as namespace packages
  2. Configuring package discovery in setup.py to find packages in the src directory

Hi @dataflake,
I suppose the reason for the ModuleNotFoundError might be a mismatch of the Zope-version and the PR goes into the wrong direction because the test fail. So, feel free to delete it.

@dataflake
Copy link
Member

No, you are bringing back old pkg_resources-style namespaces which have been deprecated a long time ago and which cause never-ending warning log entries. All namespace packages that are not archived have been switched to use implicit (PEP 420) namespace package conventions.

I am guessing you're running Zope 5.13 in your sandbox. That will not work because its Shared package is an old-style namespace package. You can only test Products.ZSQLMethods with either a master checkout of Zope or Zope 6.0b1/b2.

Closing this PR.

@dataflake dataflake closed this Jan 17, 2026
@dataflake dataflake deleted the fix_ModuleNotFoundError branch January 17, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants